Imports Infragistics.WebUI.UltraWebGrid
Imports System.Data.OleDb
Imports Microsoft.Win32
Partial Class gestComprensori
    Inherits System.Web.UI.Page

    Protected WithEvents opName As System.Web.UI.HtmlControls.HtmlInputHidden
    Protected WithEvents lkAnnulla As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lkElenco As System.Web.UI.WebControls.LinkButton
    Protected WithEvents dgEventi As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Button1 As System.Web.UI.HtmlControls.HtmlInputButton
    Protected WithEvents panNew As System.Web.UI.WebControls.Panel
    Protected WithEvents txDescrizione As System.Web.UI.WebControls.TextBox


    Dim ParentTable As String = "Tabella"

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Protected WithEvents UcTestata1 As ucTestata
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not (Page.IsPostBack) Then
            aggGridComprensori()
        End If
    End Sub
    Private Sub aggGridComprensori()
        Dim objcap As New cCapComune
        Me.dgComprensori.DataSource = objcap.caricaComprensori()
        Me.dgComprensori.DataBind()
    End Sub
    Protected Sub dgComprensori_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgComprensori.ItemCommand
        If e.CommandName = "vedi_localita" Then
            Response.Redirect("WebFormComprensorioComuni.aspx?Prov=" & HttpUtility.UrlEncode(System.Configuration.ConfigurationSettings.AppSettings("SiglaProvincia")) & "&IdCmp=" & HttpUtility.UrlEncode(e.Item.Cells(0).Text))
        End If
    End Sub
    Protected Sub dgComprensori_PageIndexChanged(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgComprensori.PageIndexChanged
        Me.dgComprensori.CurrentPageIndex = e.NewPageIndex
        aggGridComprensori()
    End Sub
End Class
